#ifndef JINPUTCONTEXT_H
#define JINPUTCONTEXT_H

#include <qpa/qplatforminputcontext.h>
#include <QTECore/jsingleton.h>

namespace QTE
{

class JInputContextPrivate;

class Q_DECL_HIDDEN JInputContext : public QPlatformInputContext
{
	Q_OBJECT

public:
	JInputContext();
	~JInputContext();

public:
	//retur true if plugin is enabled
	bool isValid() const override;

	//this value will be available in QGuiApplication::inputMethod()->keyboardRectangle()
	QRectF keyboardRect() const override;

	//this value will be available in QGuiApplication::inputMethod()->isVisible()
	bool isInputPanelVisible() const override;

	//editor pointer
	void setFocusObject(QObject *object) override;

public:
	void showInputPanel() override;
	void hideInputPanel() override;

protected:
	bool eventFilter(QObject *watched, QEvent *event) override;

private:
	JInputContextPrivate *d_ptr;
};

} //namespace QTE

#endif //JINPUTCONTEXT_H
